/*
 * ArcScript Scripts for Arcemu MMORPG Server
 * Copyright (C) 2008-2009 Arcemu Team
 * Copyright (C) 2007 Moon++ <http://www.moonplusplus.com/>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef LUA_FUNCTIONTABLES_H
#define LUA_FUNCTIONTABLES_H
/************************************************************************/
/* SCRIPT FUNCTION TABLES                                               */
/************************************************************************/

RegType<Item> ItemMethods[] = {
    { "GossipCreateMenu", &luaItem::GossipCreateMenu },
	{ "GossipMenuAddItem", &luaItem::GossipMenuAddItem },
	{ "GossipSendMenu", &luaItem::GossipSendMenu },
	{ "GossipComplete", &luaItem::GossipComplete },
	{ "GossipSendPOI", &luaItem::GossipSendPOI },
	{ "GetOwner", &luaItem::GetOwner },
	{ "AddEnchantment", &luaItem::AddEnchantment },
	{ "RemoveEnchantment", &luaItem::RemoveEnchantment },
	{ "GetEntryId", &luaItem::GetEntryId },
	{ "GetName", &luaItem::GetName },
	{ "GetSpellId", &luaItem::GetSpellId },
	{ "GetSpellTrigger", &luaItem::GetSpellTrigger },
	{ "GetGUID", &luaItem::GetGUID },
	{ "AddLoot", &luaItem::AddLoot},
	{ "SetByteValue", &luaItem::SetByteValue },
	{ "GetByteValue", &luaItem::GetByteValue },
	{ "GetItemLink", &luaItem::GetItemLink },
	{ "GetItemLevel", &luaItem::GetItemLevel },
	{ "GetRequiredLevel", &luaItem::GetRequiredLevel },
	{ "GetBuyPrice", &luaItem::GetBuyPrice },
	{ "GetSellPrice", &luaItem::GetSellPrice },
	{ "RepairItem", &luaItem::RepairItem },
	{ "GetMaxDurability", &luaItem::GetMaxDurability },
	{ "GetDurability", &luaItem::GetDurability },
	{ "HasEnchantment", &luaItem::HasEnchantment },
	{ "ModifyEnchantmentTime", &luaItem::ModifyEnchantmentTime },
	{ "SetStackCount", &luaItem::SetStackCount },
	{ "HasFlag", &luaItem::HasFlag },
	{ "IsSoulbound", &luaItem::IsSoulbound },
	{ "IsAccountbound", &luaItem::IsAccountbound },
	{ "IsContainer", &luaItem::IsContainer },
	{ "GetContainerItemCount", &luaItem::GetContainerItemCount },
	{ "GetEquippedSlot", &luaItem::GetEquippedSlot },
	{ "GetObjectType", &luaItem::GetObjectType },
	{ "Remove", &luaItem::Remove },
	{ "Create", &luaItem::Create },
	{ "ModUInt32Value", &luaItem::ModUInt32Value },
	{ "ModFloatValue", &luaItem::ModFloatValue },
	{ "SetUInt32Value", &luaItem::SetUInt32Value },
	{ "SetUInt64Value", &luaItem::SetUInt64Value },
	{ "SetFloatValue", &luaItem::SetFloatValue },
	{ "GetUInt32Value", &luaItem::GetUInt32Value },
	{ "GetUInt64Value", &luaItem::GetUInt64Value },
	{ "GetFloatValue", &luaItem::GetFloatValue },
	{ "RemoveFlag", &luaItem::RemoveFlag },
	{ "SetFlag", &luaItem::SetFlag },
	{ NULL, NULL },
};




RegType<Unit> UnitMethods[] = {
	{ "GossipCreateMenu", &luaUnit::GossipCreateMenu },
	{ "GossipMenuAddItem", &luaUnit::GossipMenuAddItem },
	{ "GossipSendMenu", &luaUnit::GossipSendMenu },
	{ "GossipComplete", &luaUnit::GossipComplete },
	{ "GossipSendPOI", &luaUnit::GossipSendPOI },
	{ "GetName", &luaUnit::GetName },
	{ "SendChatMessage", &luaUnit::SendChatMessage },
	{ "MoveTo", &luaUnit::MoveTo },
	{ "SetMovementType", &luaUnit::SetMovementType },
	{ "CastSpell", &luaUnit::CastSpell },
	{ "SpawnCreature", &luaUnit::SpawnCreature },
	{ "SpawnGameObject", &luaUnit::SpawnGameObject },
	{ "GetX", &luaUnit::GetX },
	{ "GetY", &luaUnit::GetY },
	{ "GetZ", &luaUnit::GetZ },
	{ "GetO", &luaUnit::GetO },
	{ "IsPlayer", &luaUnit::IsPlayer },
	{ "IsCreature", &luaUnit::IsCreature },
	{ "RegisterEvent", &luaUnit::RegisterEvent },
	{ "RemoveEvents", &luaUnit::RemoveEvents },
	{ "SendBroadcastMessage", &luaUnit::SendBroadcastMessage },
	{ "SendAreaTriggerMessage", &luaUnit::SendAreaTriggerMessage },
	{ "MarkQuestObjectiveAsComplete", &luaUnit::MarkQuestObjectiveAsComplete },
	{ "LearnSpell", &luaUnit::LearnSpell },
	{ "UnlearnSpell", &luaUnit::UnlearnSpell },
	{ "HasFinishedQuest", &luaUnit::HasFinishedQuest },
	{ "GetItemCount", &luaUnit::GetItemCount },
	{ "IsInCombat", &luaUnit::IsInCombat },
	{ "GetMainTank", &luaUnit::GetMainTank },
	{ "GetAddTank", &luaUnit::GetAddTank },
	{ "ClearThreatList", &luaUnit::ClearThreatList },
	{ "GetTauntedBy", &luaUnit::GetTauntedBy },
	{ "SetTauntedBy", &luaUnit::SetTauntedBy },
	{ "SetSoulLinkedWith", &luaUnit::SetSoulLinkedWith },
	{ "GetSoulLinkedWith", &luaUnit::GetSoulLinkedWith },
	{ "ChangeTarget", &luaUnit::ChangeTarget },
	{ "GetHealthPct", &luaUnit::GetHealthPct },
	{ "SetHealthPct", &luaUnit::SetHealthPct },
	{ "GetManaPct", &luaUnit::GetManaPct },
	{ "Despawn", &luaUnit::Despawn },
	{ "GetUnitBySqlId", &luaUnit::GetUnitBySqlId },
	{ "PlaySoundToSet", &luaUnit::PlaySoundToSet },
	{ "RemoveAura", &luaUnit::RemoveAura },
	{ "StopMovement", &luaUnit::StopMovement },
	{ "Emote", &luaUnit::Emote },
	{ "GetInstanceID", &luaUnit::GetInstanceID },
	{ "GetClosestPlayer", &luaUnit::GetClosestPlayer },
	{ "GetRandomPlayer", &luaUnit::GetRandomPlayer },
	{ "GetRandomFriend", &luaUnit::GetRandomFriend },
	{ "GetRandomEnemy", &luaUnit::GetRandomEnemy },
	{ "AddItem", &luaUnit::AddItem },
	{ "RemoveItem", &luaUnit::RemoveItem },
	{ "CreateCustomWaypointMap", &luaUnit::CreateCustomWaypointMap },
	{ "CreateWaypoint", &luaUnit::CreateWaypoint },
	{ "MoveToWaypoint", &luaUnit::MoveToWaypoint },
	{ "DestroyCustomWaypointMap", &luaUnit::DestroyCustomWaypointMap },
	{ "SetCombatCapable", &luaUnit::DisableCombat },
	{ "SetCombatMeleeCapable", &luaUnit::DisableMelee },
	{ "SetCombatRangedCapable", &luaUnit::DisableRanged },
	{ "SetCombatSpellCapable", &luaUnit::DisableSpells },
	{ "SetCombatTargetingCapable", &luaUnit::DisableTargeting },
	{ "SetNPCFlags", &luaUnit::SetNPCFlags },
	{ "SetModel", &luaUnit::SetModel },
	{ "SetScale", &luaUnit::SetScale },
	{ "SetFaction", &luaUnit::SetFaction },
	{ "SetStandState",&luaUnit::SetStandState },
	{ "Teleport" , &luaUnit::TeleportUnit },
	{ "GetPlayerClass", &luaUnit::GetPlayerClass },
	{ "ClearThreatList", &luaUnit::ClearHateList },
	{ "WipeThreatList", &luaUnit::WipeHateList },
	{ "WipeTargetList", &luaUnit::WipeTargetList },
	{ "WipeCurrentTarget", &luaUnit::WipeCurrentTarget },
	{ "GetHealth", &luaUnit::GetHealth },
	{ "GetMaxHealth", &luaUnit::GetMaxHealth },
	{ "SetHealth", &luaUnit::SetHealth },
	{ "SetMaxHealth", &luaUnit::SetMaxHealth },
	{ "HasAura", &luaUnit::HasAura },
	{ "Land", &luaUnit::Land },
	{ "SetFlying", &luaUnit::SetFlying },
	{ "SetMana", &luaUnit::SetMana },
	{ "SetMaxMana", &luaUnit::SetMaxMana },
	{ "GetDistance", &luaUnit::GetDistance },
	{ "GetGUID", &luaUnit::GetGUID },
	{ "GetCreatureNearestCoords", &luaUnit::GetCreatureNearestCoords },
    { "CastSpellAoF", &luaUnit::CastSpellAoF },
	{ "GetGameObjectNearestCoords", &luaUnit::GetGameObjectNearestCoords },
	{ "SetInFront", &luaUnit::SetInFront },
	{ "RemoveAllAuras", &luaUnit::RemoveAllAuras },
	{ "ReturnToSpawnPoint", &luaUnit::ReturnToSpawnPoint },
	{ "CancelSpell", &luaUnit::CancelSpell },
	{ "IsAlive", &luaUnit::IsAlive },
	{ "IsDead", &luaUnit::IsDead },
	{ "IsInWorld", &luaUnit::IsInWorld },
	{ "GetZoneId", &luaUnit::GetZoneId },
	{ "GetMana", &luaUnit::GetMana },
	{ "GetMaxMana", &luaUnit::GetMaxMana },
	{ "Root", &luaUnit::Root },
	{ "Unroot", &luaUnit::Unroot },
	{ "IsCreatureMoving", &luaUnit::IsCreatureMoving },
	{ "SetOutOfCombatRange", &luaUnit::SetOutOfCombatRange },
	{ "ModifyRunSpeed", &luaUnit::ModifyRunSpeed },
	{ "ModifyWalkSpeed", &luaUnit::ModifyWalkSpeed },
	{ "ModifyFlySpeed" , &luaUnit::ModifyFlySpeed },
	{ "GetCurrentSpell", &luaUnit::GetCurrentSpell },
	{ "IsFlying", &luaUnit::IsFlying },
	{ "SetRotation", &luaUnit::SetRotation },
	{ "SetOrientation", &luaUnit::SetOrientation },
	{ "GetSpawnX", &luaUnit::GetSpawnX },
	{ "GetSpawnY", &luaUnit::GetSpawnY },
	{ "GetSpawnZ", &luaUnit::GetSpawnZ },
	{ "GetSpawnO", &luaUnit::GetSpawnO },
	{ "GetInRangePlayersCount", &luaUnit::GetInRangePlayersCount },
	{ "GetEntry", &luaUnit::GetEntry },
	{ "SetMoveRunFlag", &luaUnit::SetMoveRunFlag },
	{ "GetAIState", &luaUnit::GetAIState },
	{ "ModUInt32Value", &luaUnit::ModUInt32Value },
	{ "ModFloatValue", &luaUnit::ModFloatValue },
	{ "SetUInt32Value", &luaUnit::SetUInt32Value },
	{ "SetUInt64Value", &luaUnit::SetUInt64Value },
	{ "SetFloatValue", &luaUnit::SetFloatValue },
	{ "GetUInt32Value", &luaUnit::GetUInt32Value },
	{ "GetUInt64Value", &luaUnit::GetUInt64Value },
	{ "GetFloatValue", &luaUnit::GetFloatValue },
	{ "SendPacket", &luaUnit::SendPacket },
	{ "AdvanceQuestObjective", &luaUnit::AdvanceQuestObjective },
	{ "Heal", &luaUnit::Heal },
	{ "Energize", &luaUnit::Energize },
	{ "SendChatMessageAlternateEntry", &luaUnit::SendChatMessageAlternateEntry },
	{ "SendChatMessageToPlayer", &luaUnit::SendChatMessageToPlayer },
	{ "SetPowerType", &luaUnit::SetPowerType },
	{ "Strike", &luaUnit::Strike },
	{ "SetAttackTimer", &luaUnit::SetAttackTimer },
	{ "Kill", &luaUnit::Kill },
	{ "DealDamage", &luaUnit::DealDamage },
	{ "IsInFront", &luaUnit::IsInFront },
	{ "IsInBack", &luaUnit::IsInBack },
	{ "IsPacified", &luaUnit::IsPacified },
	{ "IsStunned", &luaUnit::IsStunned },
	{ "IsFeared", &luaUnit::IsFeared },
	{ "CreateGuardian", &luaUnit::CreateGuardian },
	{ "HandleEvent", &luaUnit::HandleEvent },
	{ "HasInRangeObjects", &luaUnit::HasInRangeObjects },
	{ "IsInWater", &luaUnit::IsInWater },
	{ "IsInArc", &luaUnit::IsInArc },
	{ "GetInRangeObjects", &luaUnit::GetInRangeGameObjects },
	{ "GetInRangeObjectsCount", &luaUnit::GetInRangeObjectsCount },
	{ "GetAITargetsCount", &luaUnit::GetAITargetsCount },
	{ "SetUnitToFollow", &luaUnit::SetUnitToFollow },
	{ "GetUnitToFollow", &luaUnit::GetUnitToFollow },
	{ "DismissPet", &luaUnit::DismissPet },
	{ "IsPet", &luaUnit::IsPet },
	{ "SetNextTarget", &luaUnit::SetNextTarget },
	{ "GetNextTarget", &luaUnit::GetNextTarget },
	{ "SetPetOwner", &luaUnit::SetPetOwner },
	{ "GetPetOwner", &luaUnit::GetPetOwner },
	{ "CalcToDistance", &luaUnit::CalcToDistance },
	{ "CalcAngle", &luaUnit::CalcAngle },
	{ "CalcRadAngle", &luaUnit::CalcRadAngle },
	{ "SetFacing", &luaUnit::SetFacing },
	{ "SetDeathState", &luaUnit::SetDeathState },
	{ "SetInvisible", &luaUnit::IsInvisible },
	{ "SetInvincible", &luaUnit::IsInvincible },
	{ "ResurrectPlayer", &luaUnit::ResurrectPlayer },
	{ "KickPlayer", &luaUnit::KickPlayer },
	{ "CanCallForHelp", &luaUnit::CanCallForHelp },
	{ "CallForHelpHp", &luaUnit::CallForHelpHp },
	{ "SetCreatureNameById", &luaUnit::SetCreatureName },
	{ "GetAITargets", &luaUnit::GetAITargets },
	{ "GetInRangePlayers", &luaUnit::GetInRangePlayers },
	{ "GetUnitByGUID", &luaUnit::GetUnitByGUID },
	{ "RemoveFromWorld", &luaUnit::RemoveFromWorld },
	{ "GetFaction", &luaUnit::GetFaction },
	{ "EnableMoveFly", &luaUnit::MoveFly },
	{ "SpellNonMeleeDamageLog", &luaUnit::SpellNonMeleeDamageLog },
	{ "DisableRespawn", &luaUnit::NoRespawn },
	{ "ModThreat", &luaUnit::ModThreat },
	{ "GetThreat", &luaUnit::GetThreatByPtr },
	{ "GetInRangeFriends", &luaUnit::GetInRangeFriends },
	{ "GetPowerType", &luaUnit::GetPowerType },
	{ "GetMapId", &luaUnit::GetMapId },
	{ "AttackReaction", &luaUnit::AttackReaction },
	{ "EventCastSpell", &luaUnit::EventCastSpell },
	{ "IsPlayerMoving", &luaUnit::IsPlayerMoving },
	{ "IsPlayerAttacking", &luaUnit::IsPlayerAttacking },
	{ "RemoveThreat", &luaUnit::RemoveThreatByPtr },
	{ "SetPlayerAtWar", &luaUnit::SetPlayerAtWar },
	{ "GetFactionStanding", &luaUnit::GetFactionStanding },
	{ "PlaySpellVisual", &luaUnit::PlaySpellVisual },
	{ "GetPlayerLevel", &luaUnit::GetLevel },
	{ "GetLevel", &luaUnit::GetLevel },
	{ "SetPlayerLevel", &luaUnit::SetLevel },
	{ "SetLevel", &luaUnit::SetLevel },
	{ "SetStanding", &luaUnit::SetPlayerStanding },
	{ "GetStanding", &luaUnit::GetStanding },
	{ "HasItem", &luaUnit::HasItem },
	{ "AdvanceSkill", &luaUnit::AdvanceSkill },
	{ "AddSkill", &luaUnit::AddSkill },
	{ "RemoveSkill", &luaUnit::RemoveSkill },
	{ "EnableFlyCheat", &luaUnit::FlyCheat },
	{ "AddAssistTarget", &luaUnit::AddAssistTargets },
	{ "GetCurrentSpellId", &luaUnit::GetCurrentSpellId },
	{ "GetPlayerRace", &luaUnit::GetPlayerRace },
	{ "RemoveAurasByMechanic", &luaUnit::RemoveAurasByMechanic },
	{ "RemoveAurasType", &luaUnit::RemoveAurasType },
	{ "AddAura", &luaUnit::AddAura },
	{ "SetAIState", &luaUnit::SetAIState },
	{ "InterruptSpell", &luaUnit::InterruptSpell },
	{ "RemoveStealth", &luaUnit::RemoveStealth },
	{ "IsPoisoned", &luaUnit::IsPoisoned },
	{ "SetStealthLevel", &luaUnit::SetStealth },
	{ "GetStealthLevel", &luaUnit::GetStealthLevel },
	{ "IsStealthed", &luaUnit::IsStealthed },
	{ "RemoveFlag", &luaUnit::RemoveFlag },
	{ "RegisterAIUpdateEvent", &luaUnit::RegisterAIUpdateEvent },
	{ "ModifyAIUpdateEvent", &luaUnit::ModifyAIUpdateEvent },
	{ "RemoveAIUpdateEvent", &luaUnit::RemoveAIUpdateEvent },
	{ "DeleteWaypoint", &luaUnit::deleteWaypoint },
	{ "DealGoldCost", &luaUnit::DealGoldCost },
	{ "DealGoldMerit", &luaUnit::DealGoldMerit },
	{ "CanUseCommand", &luaUnit::CanUseCommand },
	{ "DeMorph", &luaUnit::DeMorph },
	{ "Attack", &luaUnit::Attack },
	{ "GetTarget", &luaUnit::GetTarget },
	{ "GetSelection", &luaUnit::GetSelection },
	{ "SetMount", &luaUnit::SetMount },
	{ "StartQuest", &luaUnit::StartQuest },
	{ "FinishQuest", &luaUnit::FinishQuest },
	{ "RepairAllPlayerItems", &luaUnit::RepairAllPlayerItems },
	{ "SetKnownTitle", &luaUnit::SetKnownTitle },
	{ "LifeTimeKills", &luaUnit::LifeTimeKills },
	{ "HasTitle", &luaUnit::HasTitle },
	{ "GetMaxSkill", &luaUnit::GetMaxSkill },
	{ "GetCurrentSkill", &luaUnit::GetCurrentSkill },
	{ "HasSkill", &luaUnit::HasSkill },
	{ "GetGuildName", &luaUnit::GetGuildName },
	{ "ClearCooldownForSpell", &luaUnit::ClearCooldownForSpell },
	{ "HasSpell", &luaUnit::HasSpell },
	{ "ClearAllCooldowns", &luaUnit::ClearAllCooldowns },
	{ "ResetAllTalents", &luaUnit::ResetAllTalents },
	{ "GetAccountName", &luaUnit::GetAccountName },
	{ "SavePlayer", &luaUnit::SavePlayer },
	{ "HasQuest", &luaUnit::HasQuest },
	{ "RemovePvPFlag", &luaUnit::RemovePvPFlag },
	{ "RemoveNegativeAuras", &luaUnit::RemoveNegativeAuras },
	{ "GossipMiscAction", &luaUnit::GossipMiscAction },
	{ "EquipWeapons", &luaUnit::EquipWeapons },
	{ "Dismount", &luaUnit::Dismount },
	{ "AdvanceAllSkills", &luaUnit::AdvanceAllSkills },
	{ "GetTeam", &luaUnit::GetTeam },
	{ "Possess", &luaUnit::Possess },
	{ "Unpossess", &luaUnit::Unpossess },
	{ "StartTaxi", &luaUnit::StartTaxi },
	//Halestorm Added Commands
	{ "ChannelSpell", &luaUnit::ChannelSpell },
	{ "StopChannel", &luaUnit::StopChannel },
	{ "EnableFlight", &luaUnit::EnableFlight },
	{ "GetCoinage", &luaUnit::GetCoinage },
	{ "FlagPvP", &luaUnit::FlagPvP },
    { "GetDisplay", &luaUnit::GetDisplay },
    { "GetNativeDisplay", &luaUnit::GetNativeDisplay },
	{ "IsMounted", &luaUnit::IsMounted },

	{ "PlaySoundToPlayer", &luaUnit::PlaySoundToPlayer },
	{ "GetDuelState", &luaUnit::GetDuelState }, 
	{ "SetPosition", &luaUnit::SetPosition},
	{ "CastSpellOnTarget", &luaUnit::CastSpellOnTarget},
	{ "GetLandHeight", &luaUnit::GetLandHeight},
	{ "QuestAddStarter", &luaUnit::QuestAddStarter},
	{ "QuestAddFinisher", &luaUnit::QuestAddFinisher},
	{ "SetPlayerSpeed", &luaUnit::SetPlayerSpeed},
	{ "GiveHonor", &luaUnit::GiveHonor},
	{ "SetBindPoint", &luaUnit::SetBindPoint},
	{ "SoftDisconnect", &luaUnit::SoftDisconnect},
	{ "SetZoneWeather", &luaUnit::SetZoneWeather},
	{ "SetPlayerWeather", &luaUnit::SetPlayerWeather},
	{ "SendPacketToPlayer", &luaUnit::SendPacketToPlayer},
	{ "PlayerSendChatMessage", &luaUnit::PlayerSendChatMessage},
	{ "GetDistanceYards", &luaUnit::GetDistanceYards},
	{ "VendorAddItem", &luaUnit::VendorAddItem},
	{ "VendorRemoveItem", &luaUnit::VendorRemoveItem},
	{ "VendorRemoveAllItems", &luaUnit::VendorRemoveAllItems},
	{ "CreatureHasQuest", &luaUnit::CreatureHasQuest},
	{ "SendVendorWindow", &luaUnit::SendVendorWindow},
	{ "SendTrainerWindow", &luaUnit::SendTrainerWindow},
	{ "SendInnkeeperWindow", &luaUnit::SendInnkeeperWindow},
	{ "SendBankWindow", &luaUnit::SendBankWindow},
	{ "SendAuctionWindow", &luaUnit::SendAuctionWindow},
	{ "SendBattlegroundWindow", &luaUnit::SendBattlegroundWindow},
	{ "GetInventoryItem", &luaUnit::GetInventoryItem},
	{ "GetInventoryItemById", &luaUnit::GetInventoryItemById},
	{ "PhaseSet", &luaUnit::PhaseSet},
	{ "PhaseAdd", &luaUnit::PhaseAdd},
	{ "PhaseDelete", &luaUnit::PhaseDelete},
	{ "GetPhase", &luaUnit::GetPhase},
	{ "AggroWithInRangeFriends", &luaUnit::AggroWithInRangeFriends},
	{ "GetPrimaryCombatTarget", &luaUnit::GetPrimaryCombatTarget},
	{ "MoveRandomArea", &luaUnit::MoveRandomArea},
	{ "SendLootWindow", &luaUnit::SendLootWindow},
	{ "AddLoot", &luaUnit::AddLoot},
	{ "SetPacified", &luaUnit::SetPacified},
	{ "SetPlayerLock", &luaUnit::SetPlayerLock},
	{ "GetGroupPlayers", &luaUnit::GetGroupPlayers},
	{ "IsGm", &luaUnit::IsGm},
	{ "GetDungeonDifficulty", &luaUnit::GetDungeonDifficulty},
	{ "GetGroupLeader", &luaUnit::GetGroupLeader},
	{ "SetGroupLeader", &luaUnit::SetGroupLeader},
	{ "AddGroupMember", &luaUnit::AddGroupMember},
	{ "SetDungeonDifficulty", &luaUnit::SetDungeonDifficulty},
	{ "ExpandToRaid", &luaUnit::ExpandToRaid},
	{ "SendPacketToGroup", &luaUnit::SendPacketToGroup},
	{ "IsGroupFull", &luaUnit::IsGroupFull},
	//next 9 credit: Alvanaar
	{ "IsGroupedWith", &luaUnit::IsGroupedWith},
	{ "GetTotalHonor", &luaUnit::GetTotalHonor},
	{ "GetHonorToday", &luaUnit::GetHonorToday},
	{ "GetHonorYesterday", &luaUnit::GetHonorYesterday},
	{ "GetArenaPoints", &luaUnit::GetArenaPoints},
	{ "AddArenaPoints", &luaUnit::AddArenaPoints},
	{ "AddLifetimeKills", &luaUnit::AddLifetimeKills},
	{ "GetGender", &luaUnit::GetGender}, //9
	{ "SetGender", &luaUnit::SetGender},
	{ "GetGroupType", &luaUnit::GetGroupType},
	//next 5: cred alvanaar
	{ "SendPacketToGuild", &luaUnit::SendPacketToGuild },
	{ "GetGuildId", &luaUnit::GetGuildId },
	{ "GetGuildRank", &luaUnit::GetGuildRank },
	{ "SetGuildRank", &luaUnit::SetGuildRank },
	{ "IsInGuild", &luaUnit::IsInGuild }, //5
	{ "SendGuildInvite", &luaUnit::SendGuildInvite },
	{ "DemoteGuildMember", &luaUnit::DemoteGuildMember },
	{ "PromoteGuildMember", &luaUnit::PromoteGuildMember },
	{ "SetGuildMotd", &luaUnit::SetGuildMotd },
	{ "GetGuildMotd", &luaUnit::GetGuildMotd },
	{ "SetGuildInformation", &luaUnit::SetGuildInformation },
	{ "AddGuildMember", &luaUnit::AddGuildMember },
	{ "RemoveGuildMember", &luaUnit::RemoveGuildMember },
	{ "SetPublicNote", &luaUnit::SetPublicNote },
	{ "SetOfficerNote", &luaUnit::SetOfficerNote },
	{ "DisbandGuild", &luaUnit::DisbandGuild },
	{ "ChangeGuildMaster", &luaUnit::ChangeGuildMaster },
	{ "SendGuildChatMessage", &luaUnit::SendGuildChatMessage },
	{ "SendGuildLog", &luaUnit::SendGuildLog },
	{ "GuildBankDepositMoney", &luaUnit::GuildBankDepositMoney },
	{ "GuildBankWithdrawMoney", &luaUnit::GuildBankWithdrawMoney },
	{ "GetInstanceOwner", &luaUnit::GetInstanceOwner },
	{ "GetGmRank", &luaUnit::GetGmRank },
	{ "SetByteValue", &luaUnit::SetByteValue },
	{ "GetByteValue", &luaUnit::GetByteValue },
	{ "IsPvPFlagged", &luaUnit::IsPvPFlagged },
	{ "IsFFAPvPFlagged", &luaUnit::IsFFAPvPFlagged },
	{ "IsFFAFlagged", &luaUnit::IsFFAPvPFlagged },
	{ "GetGuildLeader", &luaUnit::GetGuildLeader },
	{ "GetGuildMemberCount", &luaUnit::GetGuildMemberCount },
	{ "CanAttack", &luaUnit::CanAttack },
	{ "GetInRangeUnits", &luaUnit::GetInRangeUnits },
	{ "GetInRangeEnemies", &luaUnit::GetInRangeEnemies },
	{ "IsFriendly", &luaUnit::IsFriendly },
	{ "MovePlayerTo", &luaUnit::MovePlayerTo },
	// following channel funcs - Alvanaar
	{ "IsInChannel", &luaUnit::IsInChannel },
	{ "JoinChannel", &luaUnit::JoinChannel },
	{ "LeaveChannel", &luaUnit::LeaveChannel },
	{ "SetChannelName", &luaUnit::SetChannelName },
	{ "SetChannelPassword", &luaUnit::SetChannelPassword },
	{ "GetChannelPassword", &luaUnit::GetChannelPassword },
	{ "KickFromChannel", &luaUnit::KickFromChannel },
	{ "BanFromChannel", &luaUnit::BanFromChannel },
	{ "UnbanFromChannel", &luaUnit::UnbanFromChannel },
	{ "GetChannelMemberCount", &luaUnit::GetChannelMemberCount },
	{ "GetPlayerMovementVector", &luaUnit::GetPlayerMovementVector},
	{ "UnsetKnownTitle", &luaUnit::UnsetKnownTitle},
	{ "IsInPhase", &luaUnit::IsInPhase},
	{ "HasFlag", &luaUnit::HasFlag },
	{ "Repop", &luaUnit::Repop },
	{ "SetMovementFlags", &luaUnit::SetMovementFlags },
	{ "GetSpawnId", &luaUnit::GetSpawnId },
	{ "ResetTalents", &luaUnit::ResetTalents },
	{ "SetTalentPoints", &luaUnit::SetTalentPoints },
	{ "GetTalentPoints", &luaUnit::GetTalentPoints },
	{ "EventChat", &luaUnit::EventChat },
	{ "GetEquippedItemBySlot", &luaUnit::GetEquippedItemBySlot },
	{ "GetGuildMembers", &luaUnit::GetGuildMembers },
#ifdef ENABLE_ACHIEVEMENTS
	{ "AddAchievement", &luaUnit::AddAchievement },
	{ "RemoveAchievement", &luaUnit::RemoveAchievement },
	{ "HasAchievement", &luaUnit::HasAchievement },
#endif
	{ "RemoveArenaPoints", &luaUnit::RemoveArenaPoints},
	{ "TakeHonor", &luaUnit::TakeHonor},
	{ "SetPhase", &luaUnit::PhaseSet},
	{ "DeletePhase", &luaUnit::PhaseDelete},
	{ "AddToPhase", &luaUnit::PhaseAdd},
	{ "GetAreaId", &luaUnit::GetAreaId},
	{ "ResetPetTalents", &luaUnit::ResetPetTalents},
	{ "IsDazed", &luaUnit::IsDazed },
	{ "GetAura", &luaUnit::GetAura },
	{ "IsRooted", &luaUnit::IsRooted },
	{ "HasAuraWithMechanic", &luaUnit::HasAuraWithMechanic },
	{ "HasNegativeAura", &luaUnit::HasNegativeAura },
	{ "HasPositiveAura", &luaUnit::HasPositiveAura },
	{ "GetClosestEnemy", &luaUnit::GetClosestEnemy },
	{ "GetClosestFriend", &luaUnit::GetClosestFriend },
	{ "IsOnTaxi", &luaUnit::IsOnTaxi },
	{ "GetTaxi", &luaUnit::GetTaxi },
	{ "GetObjectType", &luaUnit::GetObjectType },
	{ "CreateCustomWaypoint", &luaUnit::CreateCustomWaypoint },
	{ "DeleteWaypoints", &luaUnit::DeleteAllWaypoints },
	{ "GiveXp", &luaUnit::GiveXp },
	{ "GetPower", &luaUnit::GetPower },
	{ "GetPowerPct", &luaUnit::GetPowerPct },
	{ "GetMaxPower", &luaUnit::GetMaxPower },
	{ "SetPower", &luaUnit::SetPower },
	{ "SetPowerPct", &luaUnit::SetPowerPct },
	{ "SetMaxPower", &luaUnit::SetMaxPower },
	{ "LearnSpells", &luaUnit::LearnSpells },
	{ "GetCurrentWaypoint", &luaUnit::GetCurrentWaypoint },
	{ "GetSelectedGO", &luaUnit::GetSelectedGO },
	{ "FullCastSpell", &luaUnit::FullCastSpell },
	{ "FullCastSpellOnTarget", &luaUnit::FullCastSpellOnTarget },
	{ "DisableMelee", &luaUnit::DisableMelee },
	{ "DisableRanged", &luaUnit::DisableRanged },
	{ "DisableSpells", &luaUnit::DisableSpells },
	{ "DisableCombat", &luaUnit::DisableCombat },
	{ "DisableTargeting", &luaUnit::DisableTargeting },
	{ "IsInGroup", &luaUnit::IsInGroup },
	{ "GetLocation", &luaUnit::GetLocation },
	{ "GetSpawnLocation", &luaUnit::GetSpawnLocation },
	{ "GetPlayerMovementFlags", &luaUnit::GetPlayerMovementFlags},
	{ "GetObject", &luaUnit::GetObject },
	{ "GetSecondHated", &luaUnit::GetSecondHated },
	{ "SaveToInstance", &luaUnit::SaveToInstance },
	{ "UseAI", &luaUnit::UseAI },
	{ "FlagFFA", &luaUnit::FlagFFA },
	{ "TeleportCreature", &luaUnit::TeleportCreature },
	{ "IsInDungeon", &luaUnit::IsInDungeon },
	{ "IsInRaid", &luaUnit::IsInRaid },
	{ "CreateLuaEvent", &luaUnit::CreateLuaEvent },
	{ "IsHostile", &luaUnit::IsHostile },
	{ "IsAttackable", &luaUnit::IsAttackable },
	{ "GetNumWaypoints", &luaUnit::GetNumWaypoints },
	{ "GetWayPointsCount", &luaUnit::GetNumWaypoints },
	{ "GetMoveType", &luaUnit::GetMovementType },
	{ "GetQuestLogSlot", &luaUnit::GetQuestLogSlot },
	{ "GetAuraObject", &luaUnit::GetAuraObject },
	{ "GetAuraStackCount", &luaUnit::GetAuraStackCount },
	{ "AddAuraObject", &luaUnit::AddAuraObject },
	{ "GetAuraObjectById", &luaUnit::GetAuraObjectById },
	{ "GetNativeFaction", &luaUnit::GetNativeFaction },
	{ "StopPlayerAttack", &luaUnit::StopPlayerAttack },
	{ "GetQuestObjectiveCompletion", &luaUnit::GetQuestObjectiveCompletion },
	{ "FullCastSpellAoF", &luaUnit::FullCastSpellAoF },
	{ "GetClosestUnit", &luaUnit::GetClosestUnit },
	{ "FullCastSpellAoE", &luaUnit::FullCastSpellAoF },
	{ "CastSpellAoE", &luaUnit::CastSpellAoF },
	{ "SetFlag", &luaUnit::SetFlag },
	{ "SetSelectedGO", &luaUnit::SetSelectedGO },
	{ NULL, NULL },
};

RegType<GameObject> GOMethods[] = {
	{ "GetGUID", &luaGameObject::GetGUID },
	{ "GetName", &luaGameObject::GetName },
	{ "GetCreatureNearestCoords", &luaGameObject::GetCreatureNearestCoords },
	{ "GetAreaId", &luaGameObject::GetAreaId },
	{ "GetGameObjectNearestCoords", &luaGameObject::GetGameObjectNearestCoords },
	{ "GetZoneId", &luaGameObject::GetZoneId },
	{ "GetClosestPlayer", &luaGameObject::GetClosestPlayer },
	{ "SpawnCreature", &luaGameObject::SpawnCreature },
	{ "SpawnGameObject", &luaGameObject::SpawnGameObject },
	{ "IsInWorld", &luaGameObject::IsInWorld },
	{ "GetSpawnX", &luaGameObject::GetSpawnX },
	{ "GetSpawnY", &luaGameObject::GetSpawnY },
	{ "GetSpawnZ", &luaGameObject::GetSpawnZ },
	{ "GetSpawnO", &luaGameObject::GetSpawnO },
	{ "GetInRangePlayersCount", &luaGameObject::GetInRangePlayersCount },
	{ "GetEntry", &luaGameObject::GetEntry },
	{ "SetOrientation", &luaGameObject::SetOrientation },
	{ "GetX", &luaGameObject::GetX },
	{ "GetY", &luaGameObject::GetY },
	{ "GetZ", &luaGameObject::GetZ },
	{ "GetO", &luaGameObject::GetO },
	{ "RemoveFromWorld", &luaGameObject::RemoveFromWorld },
	{ "CalcRadAngle", &luaGameObject::CalcRadAngle },
	{ "GetInstanceID", &luaGameObject::GetInstanceID },
	{ "GetInRangePlayers", &luaGameObject::GetInRangePlayers },
	{ "GetInRangeObjects", &luaGameObject::GetInRangeGameObjects },
	{ "IsInBack", &luaGameObject::IsInBack },
	{ "IsInFront", &luaGameObject::IsInFront },
	{ "GetMapId", &luaGameObject::GetMapId },
	{ "SetUInt32Value", &luaGameObject::SetUInt32Value },
	{ "SetUInt64Value", &luaGameObject::SetUInt64Value },
	{ "SetFloatValue", &luaGameObject::SetFloatValue },
	{ "GetUInt32Value", &luaGameObject::GetUInt32Value },
	{ "GetUInt64Value", &luaGameObject::GetUInt64Value },
	{ "GetFloatValue", &luaGameObject::GetFloatValue },
	{ "ModUInt32Value", &luaGameObject::ModUInt32Value },
	{ "CastSpell", &luaGameObject::CastSpell },
	{ "CastSpellOnTarget", &luaGameObject::CastSpellOnTarget },
	{ "GossipObjectCreateMenu", &luaGameObject::GossipCreateMenu },
	{ "GossipObjectMenuAddItem", &luaGameObject::GossipMenuAddItem }, 
	{ "GossipObjectSendMenu", &luaGameObject::GossipSendMenu },
	{ "GossipObjectComplete", &luaGameObject::GossipComplete },
	{ "GossipObjectSendPOI", &luaGameObject::GossipSendPOI },
	{ "GossipCreateMenu", &luaGameObject::GossipCreateMenu },
	{ "GossipMenuAddItem", &luaGameObject::GossipMenuAddItem }, 
	{ "GossipSendMenu", &luaGameObject::GossipSendMenu },
	{ "GossipComplete", &luaGameObject::GossipComplete },
	{ "GossipSendPOI", &luaGameObject::GossipSendPOI },
	{ "RegisterAIUpdateEvent", &luaGameObject::RegisterAIUpdate },
	{ "ModifyAIUpdateEvent", &luaGameObject::ModAIUpdate },
	{ "RemoveAIUpdateEvent", &luaGameObject::RemoveAIUpdate },
	{ "Activate", &luaGameObject::Activate },
	{ "IsActive", &luaGameObject::IsActive },
	{ "Despawn", &luaGameObject::DespawnObject },
	{ "GetLandHeight", &luaGameObject::GetLandHeight},
	{ "SetZoneWeather", &luaGameObject::SetZoneWeather},
	{ "PhaseSet", &luaGameObject::PhaseSet},
	{ "PhaseAdd", &luaGameObject::PhaseAdd},
	{ "PhaseDelete", &luaGameObject::PhaseDelete},
	{ "GetPhase", &luaGameObject::GetPhase},
	{ "SendPacket", luaGameObject::SendPacket },
	{ "AddLoot", &luaGameObject::AddLoot},
	{ "Update", &luaGameObject::Update}, //sadikum
	{ "GetInstanceOwner", &luaGameObject::GetInstanceOwner },
	{ "GetDungeonDifficulty", &luaGameObject::GetDungeonDifficulty },
	{ "SetDungeonDifficulty", &luaGameObject::SetDungeonDifficulty },
	{ "HasFlag", &luaGameObject::HasFlag },
	{ "IsInPhase", &luaGameObject::IsInPhase},
	{ "SetPhase", &luaGameObject::PhaseSet},
	{ "DeletePhase", &luaGameObject::PhaseDelete},
	{ "AddToPhase", &luaGameObject::PhaseAdd},
	{ "GetAreaId", &luaGameObject::GetAreaId},
	{ "SetPosition", &luaGameObject::SetPosition},
	{ "GetObjectType", &luaGameObject::GetObjectType},
	{ "PlaySoundToSet", &luaGameObject::PlaySoundToSet },
	{ "GetDistance", &luaGameObject::GetDistance },
	{ "GetDistanceYards", &luaGameObject::GetDistanceYards },
	{ "GetSpawnId", &luaGameObject::GetSpawnId },
	{ "ChangeScale", &luaGameObject::ChangeScale },
	{ "GetByte", &luaGameObject::GetByte },
	{ "GetByteValue", &luaGameObject::GetByte },
	{ "SetByte", &luaGameObject::SetByte },
	{ "SetByteValue", &luaGameObject::SetByte },
	{ "FullCastSpell", &luaGameObject::FullCastSpell },
	{ "FullCastSpellOnTarget", &luaGameObject::FullCastSpellOnTarget },
	{ "CustomAnimate", &luaGameObject::CustomAnimate },
	{ "GetLocation", &luaGameObject::GetLocation },
	{ "GetSpawnLocation", &luaGameObject::GetSpawnLocation },
	{ "GetObject", &luaGameObject::GetObject },
	{ "GetClosestPlayer", &luaGameObject::GetClosestPlayer },
	{ "CreateLuaEvent", &luaGameObject::RegisterEvent },
	{ "RemoveEvents", &luaGameObject::RemoveEvents },
	{ "SetScale", &luaGameObject::SetScale },
	{ "GetScale", &luaGameObject::GetScale },
	{ "GetInRangeUnits", &luaGameObject::GetInRangeUnits },
	{ "GetClosestUnit", &luaGameObject::GetClosestUnit },
	{ "SetFlag", &luaGameObject::SetFlag },
	{ "RemoveFlag", &luaGameObject::RemoveFlag },
	{ NULL, NULL },
};

RegType<WorldPacket> LuaPacketMethods[] = {
	{"CreatePacket", &luPacket::CreatePacket },
	{ "GetOpcode", &luPacket::GetOpcode },
	{ "GetSize", &luPacket::GetSize },
	//READ OPERATIONS
	{"ReadByte", &luPacket::ReadByte },
	{"ReadUByte", &luPacket::ReadUByte },
	{"ReadShort", &luPacket::ReadShort },
	{"ReadUShort",&luPacket::ReadUShort },
	{"ReadLong", &luPacket::ReadLong },
	{"ReadULong", &luPacket::ReadULong },
	{"ReadFloat",&luPacket::ReadFloat },
	{"ReadDouble", &luPacket::ReadDouble },
	{"ReadGUID",&luPacket::ReadGUID },
	{"ReadWoWGuid",&luPacket::ReadWoWGuid },
	{"ReadString", &luPacket::ReadString },
	//WRITE OPERATIONS
	{"WriteUByte", &luPacket::WriteUByte },
	{"WriteByte", &luPacket::WriteByte },
	{"WriteShort",&luPacket::WriteShort },
	{"WriteUShort",&luPacket::WriteUShort },
	{"WriteLong", &luPacket::WriteLong },
	{"WriteULong", &luPacket::WriteULong },
	{"WriteFloat", &luPacket::WriteFloat },
	{"WriteDouble", &luPacket::WriteDouble },
	{"WriteGUID", &luPacket::WriteGUID },
	{"WriteWoWGuid", &luPacket::WriteWoWGuid },
	{"WriteString", &luPacket::WriteString },
	{"GetObjectType", &luPacket::GetObjectType},
	{NULL, NULL},
};

RegType<TaxiPath> LuaTaxiMethods[] = {
	{ "CreateTaxi", &LuaTaxi::CreateTaxi },
	{ "GetNodeCount", &LuaTaxi::GetNodeCount },
	{ "AddPathNode", &LuaTaxi::AddPathNode },
	//{ "GetNodeX", &LuaTaxi::GetNodeX },
	//{ "GetNodeY", &LuaTaxi::GetNodeY },
	//{ "GetNodeZ", &LuaTaxi::GetNodeZ },
	//{ "GetNodeMapId", &LuaTaxi::GetNodeMapId },
	{ "GetId", &LuaTaxi::GetId },
	{ "GetObjectType", &LuaTaxi::GetObjectType},
	{NULL, NULL},
};

RegType<Spell> SpellMethods[] = {
	{ "GetCaster", &LuaSpell::GetCaster },
	{ "GetEntry", &LuaSpell::GetEntry },
	{ "IsDuelSpell", &LuaSpell::IsDuelSpell },
	{ "GetSpellType", &LuaSpell::GetSpellType },
	{ "GetSpellState", &LuaSpell::GetSpellState },
	{ "Cancel", &LuaSpell::Cancel },
	{ "Cast", &LuaSpell::Cast },
	{ "CanCast", &LuaSpell::CanCast },
	{ "Finish", &LuaSpell::Finish },
	{ "GetTarget", &LuaSpell::GetTarget },
	{ "IsStealthSpell", &LuaSpell::IsStealthSpell },
	{ "IsInvisibilitySpell", &LuaSpell::IsInvisibilitySpell },
	{ "GetPossibleEnemy", &LuaSpell::GetPossibleEnemy },
	{ "GetPossibleFriend", &LuaSpell::GetPossibleFriend },
	{ "HasPower", &LuaSpell::HasPower },
	{ "IsAspect", &LuaSpell::IsAspect },
	{ "IsSeal", &LuaSpell::IsSeal },
	{ "GetObjectType", &LuaSpell::GetObjectType},
	{ "SetVar", &LuaSpell::SetVar},
	{ "GetVar", &LuaSpell::GetVar},
	{ "ResetVar", &LuaSpell::ResetVar},
	{ "ResetAllVars", &LuaSpell::ResetAllVars},
	{ "GetCastedItemId", &LuaSpell::GetCastedItemId},
	{NULL, NULL},
};
RegType<QueryResult> QResultMethods[] = 
{
	{"GetColumn", &luaSql::GetColumn },
	{"NextRow", &luaSql::NextRow },
	{"GetColumnCount", &luaSql::GetColumnCount },
	{"GetRowCount", &luaSql::GetRowCount },
	{ NULL, NULL},
};
RegType<Field> SQLFieldMethods[] = {
	{"GetByte", &luaSql::GetByte },
	{"GetUByte", &luaSql::GetUByte },
	{"GetShort", &luaSql::GetShort },
	{"GetUShort", &luaSql::GetUShort},
	{"GetLong", &luaSql::GetLong },
	{"GetULong", &luaSql::GetULong },
	{"GetString",&luaSql::GetString },
	{"GetGUID", &luaSql::GetGUID },
	{"GetFloat", &luaSql::GetFloat },
	{"GetBool", &luaSql::GetBool },
	{NULL, NULL},
};

RegType<Aura> AuraMethods[] = {
	{"GetObjectType", &LuaAura::GetObjectType},
	{"GetSpellId", &LuaAura::GetSpellId},
	{"GetCaster", &LuaAura::GetCaster},
	{"GetTarget", &LuaAura::GetTarget},
	{"GetDuration", &LuaAura::GetDuration},
	{"SetDuration", &LuaAura::SetDuration},
	{"GetTimeLeft", &LuaAura::GetTimeLeft},
	{"SetNegative", &LuaAura::SetNegative},
	{"SetPositive", &LuaAura::SetPositive},
	{"Remove", &LuaAura::Remove},
	{"SetVar", &LuaAura::SetVar},
	{"GetVar", &LuaAura::GetVar},
	{"GetAuraSlot", &LuaAura::GetAuraSlot},
	{"SetAuraSlot", &LuaAura::SetAuraSlot},
	{NULL, NULL},
};

template<typename T> RegType<T>* GetMethodTable() { return NULL; }
template<> RegType<Unit>* GetMethodTable<Unit>() { return UnitMethods; }
template<> RegType<Item>* GetMethodTable<Item>() { return ItemMethods; }
template<> RegType<GameObject>* GetMethodTable<GameObject>() { return GOMethods; }
template<> RegType<WorldPacket>* GetMethodTable<WorldPacket>() { return LuaPacketMethods; }
template<> RegType<TaxiPath>* GetMethodTable<TaxiPath>() { return LuaTaxiMethods; }
template<> RegType<Spell>* GetMethodTable<Spell>() { return SpellMethods; }
template<> RegType<QueryResult>* GetMethodTable<QueryResult>() { return QResultMethods; }
template<> RegType<Field> * GetMethodTable<Field>() { return SQLFieldMethods; }
template<> RegType<Aura> * GetMethodTable<Aura>() { return AuraMethods; }

#endif